<?php

class Default_Model_Product extends Zend_Db_Table_Abstract{
    public $_name="product";                    
    public function getDataRandom($qty){
        $query = $this->select()                      
                        ->setIntegrityCheck(false)
                        ->from($this->_name)
                        ->where('display = 1')
                        ->where('highlight = 1')
                        ->limit($qty)                  
                        ->order('rand()');                                                 
        return $this->fetchAll($query);  
    }    
    public function getDataByItemId($id){
        $query = $this->select()                                              
                        ->from($this->_name)
                        ->where('itemId = ?',(int)$id);                                                                         
        return $this->fetchAll($query);
    }    
    public function updateCat($data,$id){
        $this->update($data,"id=$id");          
    }
}